import openpyxl
from openpyxl.styles import Font, NamedStyle,PatternFill

PRICE_UPDATES = {'Garlic': 3.07, 'Celery': 1.19, 'lemon': 1.27}
wb = openpyxl.load_workbook('produceSales.xlsx')
sheets = wb.sheetnames
print(sheets)
sheet = wb[sheets[0]]
italic24Font = Font(size=24, bold=True, name='Arial')
styleObj = NamedStyle(name='MyStyle')
styleObj.font = italic24Font
styleObj.fill = PatternFill(start_color='FFFF00', end_color='FFFF00', fill_type='solid')
for rowNum in range(2, sheet.max_row):
    productName = sheet.cell(row=rowNum, column=1).value
    if productName in PRICE_UPDATES:
        print(productName)
        cell = sheet.cell(row=rowNum, column=2)
        cell.value = PRICE_UPDATES[productName]
        cell.style = styleObj

wb.save("produceSales1.xlsx")
